package com.gialen.tools.dao.repository.gialen;

import com.gialen.common.model.PageRequest;
import com.gialen.tools.dao.dto.ActivityUserDetailDto;
import com.gialen.tools.dao.dto.CommunityDto;
import com.gialen.tools.dao.entity.gialen.BlcCustomerRelation;
import com.gialen.tools.dao.entity.gialen.BlcCustomerRelationExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@org.springframework.stereotype.Repository
public interface BlcCustomerRelationMapper {

    /**
     * 统计店经的店主和vip社群数据
     * @param managerId
     * @param month
     * @param day
     * @return
     */
    CommunityDto countIndirectStoreAndVipNumForManager(@Param("managerId") Long managerId, @Param("month") Integer month, @Param("day") Integer day,
                                                       @Param("userName") String userName);

    /**
     * 查询店经的月新增vip列表
     * @param managerId
     * @param day
     * @param month
     * @param page
     * @return
     */
    List<CommunityDto> getMonthNewVipListForManager(@Param("managerId") Long managerId, @Param("day") Integer day,
                                                    @Param("month") Integer month, @Param("page") PageRequest page,
                                                    @Param("storeName") String storeName);

    /**
     * 统计店经的月度 有新增vip的店主数量
     * @param managerId
     * @param month
     * @return
     */
    Long countMonthHasNewVipStoreNumForManager(@Param("managerId") Long managerId, @Param("month") Integer month, @Param("storeName") String storeName);

    /**
     * 统计店经的活跃或静默店主数量
     * @param userId
     * @param month
     * @param dataType
     * @param storeName
     * @return
     */
    Long countActivityOrSilenceStoreTotalForManager(@Param("userId") Long userId, @Param("month") Integer month,
                                                    @Param("dataType") Byte dataType, String storeName);

    /**
     * 查询店经的活跃或静默店主列表
     * @param userId
     * @param month
     * @param dataType
     * @param pageRequest
     * @param storeName
     * @return
     */
    List<ActivityUserDetailDto> getActivityOrSilenceStoreListForManager(@Param("userId") Long userId, @Param("month") Integer month,
                                                                        @Param("dataType") Byte dataType, @Param("page") PageRequest pageRequest,
                                                                        @Param("storeName") String storeName);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer_relation
     *
     * @mbg.generated
     */
    long countByExample(BlcCustomerRelationExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer_relation
     *
     * @mbg.generated
     */
    int deleteByExample(BlcCustomerRelationExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer_relation
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer_relation
     *
     * @mbg.generated
     */
    int insert(BlcCustomerRelation record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer_relation
     *
     * @mbg.generated
     */
    int insertSelective(BlcCustomerRelation record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer_relation
     *
     * @mbg.generated
     */
    List<BlcCustomerRelation> selectByExample(BlcCustomerRelationExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer_relation
     *
     * @mbg.generated
     */
    BlcCustomerRelation selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer_relation
     *
     * @mbg.generated
     */
    int updateByExampleSelective(@Param("record") BlcCustomerRelation record, @Param("example") BlcCustomerRelationExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer_relation
     *
     * @mbg.generated
     */
    int updateByExample(@Param("record") BlcCustomerRelation record, @Param("example") BlcCustomerRelationExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer_relation
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(BlcCustomerRelation record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer_relation
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(BlcCustomerRelation record);
}